package net.maergaiyun.strategy;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class ShardingTableConfig {
    private static final List<String> tableSuffixList = new ArrayList<>();

    private static final Random random = new Random();

    static {
        tableSuffixList.add("0");
        tableSuffixList.add("a");
    }

    public static String getRandomTableSuffix(String code) {
        int hashCode = code.hashCode();
        int index = Math.abs(hashCode) % tableSuffixList.size();
        return tableSuffixList.get(index);
    }
}
